package com.kuang.dao;

import com.kuang.pojo.User;
import org.apache.ibatis.annotations.*;
import java.util.List;

public interface UserMapper {
//    查询所有用户
    @Select("select * from user")
    List<User> getUserAll();
//    根据id查询用户
    @Select("select * from user where id = #{id}")
    List<User> getUserById(@Param("id") int id);
//    新增用户
    @Insert("insert into user (id,name,pwd) values (#{id},#{name},#{pwd})")
    int addUser(User user);
//    更新用户
    @Update("update user set name = #{name} where id = #{id}")
    int updateUser(User user);
//    删除用户
    @Delete("delete from user where id = #{id}")
    int deleteUser(@Param("id") int id);
}
